package com.example.demo.pdfbox.tabel.form;

import com.example.demo.pdfbox.common.PdfBorder;
import com.example.demo.pdfbox.tabel.PdfElement;
import lombok.Getter;
import lombok.Setter;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

@Getter

public class PdfColumn extends PdfBorder implements Serializable {

    private float width;
    private int colspan;
    private int rowspan;
    private float paddingLeft = 1;

    /**
     * Right padding of the cell.
     */
    private float paddingRight = 1;

    /**
     * Top padding of the cell.
     */
    private float paddingTop = 0;

    /**
     * Bottom padding of the cell.
     */
    private float paddingBottom = 0;

    private PdfElement element;


    public void addElement(PdfElement element) {

        this.element = element;
    }

    public PdfColumn setWidth(float width) {
        this.width = width;
        return this;
    }

    public PdfColumn setColspan(int colspan) {
        this.colspan = colspan;
        return this;
    }

    public PdfColumn setRowspan(int rowspan) {
        this.rowspan = rowspan;
        return this;
    }

    public PdfColumn setPaddingLeft(float paddingLeft) {
        this.paddingLeft += paddingLeft;
        return this;
    }

    public PdfColumn setPaddingRight(float paddingRight) {
        this.paddingRight += paddingRight;
        return this;
    }

    public PdfColumn setPaddingTop(float paddingTop) {
        this.paddingTop += paddingTop;
        return this;
    }

    public PdfColumn setPaddingBottom(float paddingBottom) {
        this.paddingBottom += paddingBottom;
        return this;
    }
}
